#!/bin/bash  

package=$1

if [ ! $1 ]; then
	echo '参数不对，请输入项目路径'
    exit 0
fi
root=$(cd `dirname $0`; pwd)
a=`uname  -a`
mac="Darwin"
wxFileDir=${root}/src/main/java/com/tange365/demo
wxFile=${wxFileDir}/wxapi/WXEntryActivity.java
rep="s#com.tange365.demo#"${package}"#g"
if [[ $a =~ $mac ]];then
   sed -i "" ${rep}  $wxFile
else
    sed -i  ${rep}  $wxFile
fi
path=${root}'/src/main/java/'${package//./\/}
mkdir -p $path
cp -r $wxFileDir/*  $path
rm -rf  $wxFileDir



